// 班级模块所有请求
import request from '@/utils/request'
// /class/student
export function addClass(params) {
  return request({
    url: '/class/student',
    method: 'GET',
    params
  })
}
// class/student   class/student
export function delClass(id) {
  return request({
    url: `/class/student`,
    method: 'DELETE',
    data: {
      id
    }
  })
}

export function getCataTree() {
  return request({
    url: '/subject/tree',
    method: 'get'
  })
}

export function classclass(params) {
  return request({
    url: '/class/class',
    method: 'get',
    params
  })
}

// 搜索学生信息
export const searchForStudentInformation = params => {
  return request({
    url: '/class/student',
    method: 'GET',
    params
  })
}

// 新增学生
export const newStudents = data => {
  return request({
    url: '/class/student',
    method: 'POST',
    data
  })
}

// 根据id获取学生数据
export const accessStudentsDataToId = id => {
  return request({
    url: `/class/student/${id}`,
    method: 'GET'
  })
}

// 根据id更新用户数据
export const updateUserData = data => {
  return request({
    url: `/class/student/${data.id}`,
    method: 'PUT',
    data
  })
}

// 批量启用
export const batchEnable = data => {
  return request({
    url: '/class/studentChangeStatus',
    method: 'PUT',
    data
  })
}
// excel上传
export const uploadForm = list => {
  return request({
    url: '/class/student/import',
    method: 'POST',
    data: {
      list
    }
  })
}

// 班级列表请求接口
export function getClassList(params) {
  return request({
    url: '/class/class',
    method: 'GET',
    params
  })
}
// 编辑回显接口
// export function postStatus(data) {
//   return request({
//     url: `/class/class/${data.id}`,
//     method: 'PUT',
//     data
//   })
// }

// 获取学科接口
export const getTreeList = () => {
  return request({
    url: '/subject/tree'
  })
}
// 添加班级接口
export function addSubjectClasss(data) {
  return request({
    url: '/class/class',
    method: 'POST',
    data
  })
}
// 老师信息的请求：
export function teacher(params) {
  return request({
    method: 'GET',
    url: '/class/teacher',
    params
  })
}
// 助教老师信息的请求：
export function teacherZhu(params) {
  return request({
    method: 'GET',
    url: '/class/teacher',
    params
  })
}// 班主任信息的请求：
export function teacherBan(params) {
  return request({
    method: 'GET',
    url: '/class/teacher',
    params
  })
}
// 删除接口
export function deleteClass(id) {
  return request({
    method: 'delete',
    url: `/class/class/${id}`

  })
}
// 修改编辑接口
export function editClass(id) {
  return request({
    url: `/class/class/${id}`,
    method: 'GET'
  })
}

